Fix documentation format and some type check