Fixing bugs introduced to OctoTools in last push *sigh*

Really sorry - my last PR was largely junk because I didn't test it properly. 

Fixed the problems and done some testing now too.