fixes #126 and #127