rescued a few fixes from GlitchMr's pull request