Fixes #47 and fixes #49