More cleanups and documentation in media related stuff.