Stop assuming that library_id == pk.