Ensure gateway class is loaded up when saving. Closes #2154.
kses