Fixes #1466.
Merge pull request #1494 from seanpaultaylor/next

Fixes #1466.