Fixes #28, #34, #35