Fix issue with unencoded `#` in type and medium URIs (#57)