Fixed some minor problems. Code cleanup.