When Miles is sent to his room by Uncle Flick, he fixes the bed, shuts the door, and right before he climbs out the window, he goes to turn off the lamp, but the light goes off before he turns the switch.
Miles trips as he's running to Mason in court and the shoe box flies to the judge's bench and when the gun falls out Burger picks it up by the handle compromising any finger prints on the gun.