Cleanup debug.
Cleaned up some logic.