Fixes #24
Adding diagnostic message to find cause of #48
Fixes #47