Fix attachment ordering with negative values