Fixed recording in debug and release builds.