Added debugging to help investigate issue #6