Minor fixes & add two small utils