fixes #47 and #48