fixes submitted by @der-bruemmer