Add debugging prints and asserts.