Good job. Seems to be fixed.
One minor issue I noticed is that the swords sometimes miss because they spawn behind the enemy. You should probably be taking the speed of the enemy into account and spawning the sword a bit in front of it.