Closes #507