fixes #50 and #43