Handle number casts and move some doc-strings