Fixes for the gateway