Tweaks: show debugging info, guard against NaN crash correctly