Fixed bugs with minus sign