why set the gun towards the mouse?
you could just set the bullet angle towards the mouse, right?
I'm not sure what is causing the bullets to be off, but it might have to do with the layer, using mouse.x(0) and mouse.y(0) would solve that in that case..