Fixed some BUGS