fixes #499
fixes #541