Set debug by test_environment option. Fix #504

I just realized it's a bool, and can just straight set it here. Pushed the fix.