Fix for controller initialisation, and some debug tidy up