only do expensive conversions in DEBUG mode

Quick fix for #192