This fixes #35 and #38