Fix tags bugs for last objects

Needed to check if the token was an array or not and continue from there
to the appropriate action.