fixes #51 and #48