Fixed problems with sign error test