Imported assorted fixes