Fix gateway handling in capistrano deploy