Fixes for errors found in testing.