improved typing of some builtin functions