Possible fix for issue #101

Please try out these changes and let me know if they work