Misc bugfixes for WebApi 5.0.