Allows undef to be a valid type for reference directory.
Merge branch 'lean'