fixes #50 and fixes #52