Some fixes from Shyam's feedback