Resolve references manually, other little fixes