Fix for #3

commited many other commits, which for some strange reason are not
present here. Sorry for this commit.