Massive amount of cleanup.
Merged in changes from develop