Cleaned up code and fixed some errors.