Cleaned up code and made style fixes.