fix crash on debug mode (issue #96)