Remove unused variable
Use shift and OR instead of multiplication by magic number
More descriptive error message
Use attribute references instead of string expansions.

Which skips a few steps of xlat.

If the attribute doesn't exist, it's value defaults to zero
Allow cast of ifid to integer64
Change ! to ~, as that's what it really is.