That would mean to change the SQL query to return not only the id but also the catid. I'm not that sure how the various databases will work with a max() statement and an added field. I'd like to leave that as it is for now to not introduce unexpected bugs.