tidy up some bugs after testing previous commits