Finish tests for Gateway

Closes #179