Fixed some bugs
Fixed minor bugs