Resolves #1, fixes #3