Fix bugs and Clean up.