Merged changes in Media from Martin Sjoelund's fork