Added support for unit types and functions