Code cleanup.
Simplified #257 test.
Fixed #257.