Fixes #4

More elegant fix to #4