Corrected minor bugs.
Cleaned up the code.
Continued fixing code.