Add function to convert deferred objs to real objs, also fixed duplicates in first result set of a query