Clean up, small fix and debug statements