Various fixes from Starscream's suggestions