Bug fixes from testing.
Merge remote-tracking branch 'origin/master'