fixes #50 and #49