debug and mismatch cleanups