Fixed some bugs I fond whilst doing my tech demo