Fix bug with fetching object through belongs_to or has_one association.