fixes according to issue #222 comments