Minor fixes. Cleaned up code.