downgrade to 4.0

support for media types
a few misc. bugfixes