Added error for negative square-roots and div by 0.