fix bugs with hapi 2.0.x