added cleanup flags and minor improvements to projectile collision