Some fixes follwing Fred's comments.