Fixes up first round of mistakes and cock ups