Fix 177

This should fix both issues listed in issue #177