Fix --geometry producing wrong results