Wrapped some debugging stuff in ifdefs.