Closes #539