Handle dimension for built-in functions.

Non-template user-defined functions are still not handled.