fixes #228, #225, #212