Added wrapper to test_mode check to avoid possible errors: