fixes #511