Fixes #43, #37