Updated with commits from #78
Fix for Issue #74