fixes according to comments on pullrequest