Fixed from_dict and from_obj methods returning the wrong object