Fixed a few cleaning up issues