Cleanup.
Fixed #473 on 3.0 branch.