Fix some exit codes and lookup