Various combined fixes

This PR combines the previous 4.