Closes #45.  Also fixed a bug I missed in the fix to issue #56.