Fixes #50, fixes #49, fixes #28