Finished port of 1.5.1, lots of tidy ups