Fix issues reported by Reynold