fix #121 and #127

needs https://github.com/ukoethe/lazyflow/commit/028b3272dafc0044003ad7d5b1764f63c4d71186 (corresponding pull request must be applied first)