Fixed error in hazard function