Closes #991