fix some trivial errors which were breaking everything
it would help if the lookup logic were not completely wrong