Fixed some bugs more to go