Miscellaneous code improvements

These are from the Universal Port feature topical branch
Reviewers: @nbougalis @miguelportilla