Fix upsample for factors > 2