Added new test for fix to #582 (fixes 582)