Fixes to bugs that Rob found