Fixed some type-detection issues for JSON-based interfaces