Fixes #31 and fixes #32