important bug fixes #124, #125