A few minor changes for bugs found in testing