fixes for pullrequest #4