fixes #129 and #126