Support None if initial part of dotted lookup returns None. Closes #1223.