Fix media changes not being cleared up correctly