Merge improvements from @dceddia