Clean code and fixed some bugs...