Investigating and fixing a subtle bug with physics