Add nameOf and fix various errors.