minor fix to tag detection/return code