Fixed some bugs found on update attempt