Fixed up debugging and cleaned up the calls