Merge coverty scan changes from master