Fix for issue #503

Fixes issue #503