Fixes #51, fixes #52