Fix bugs
Bugs fixed