Added conditions to to_obj() in yara test mechanism