Fix.

Merge this into branch java6 after review.