Fix bug in bond convexity function