Cleanup, Fixed some bugs.