Fixes according to MorrisJobke's comments