Merging fixes from various old PR's.