Misc fixes as per Tam's comments.