fixes #576 and part of #575