Bug fix: all basic tests pass