Remove expensive checks from non-debug builds.