Fixed a possible error in the model getRelated() method