Fix bug in use of unsafePerformIO
wee optimisation
fixing bugs etc