Fixes #103, fixes #113.