Bug fixes from testing.