Fixes #44. Fixes #39.