Fixed compilation issue and moved gsp into the switch statement.