Fixed possible infinite loop on filling liquids