Removed some unneeded code, fixed some errors.
Removed some unneeded code, fixed some errors.