Media : unit testing and fixes