Fix/524

Fixes issue #524