A few bug fixes.

A few bug fixes.