Fix a number of outstanding issues