minor optimisations, minor gameplay bugfix