Fix sign handling logic

math...