Final barrier id casting logic.

This commit follow up on the stated intent in my previous commit to
omit the "(int)" cast when the expression already has integer type.

I believe this to be the final commit to fix issue #44.