Various patches that should be ready for master