fixes #533,534,535,536,537,538,539