Fix for issue #35 and issue #36

In commit 99c9a42 I meant to reference issue #35 (not 31)