Fixed sign() function.