Fixed potential bugs with moving objects