Revert "Fix issue 562"

This reverts commit 44160f30eeef720ce589b61cc1ec9736b3c36bdf.
Fixing 562 in a more general way