Fixes #498

This PR fixes #498.