Fixes #737 (makes tests pass).