Various pre-deployment fixes

See commits