fixes #288 and #289