Gateway error fixes