Fixed sign flip bug.