fixes #15 and #26