Fixed tests, merged lookup functions