1) Fixed some bugs