Fix bugs 484 and 485.