Fix sign() to return 0 when n is 0.