fixed a return type bug for builtins. fix another bug in stats.