Pull fixes from bug # 267 from the head