Various fixes, cleaned up code
Make clean'd