fixes #623
fixes #818