Hi. You'll have to combine your BadVal() check with a check for questionable values.
Use the IsSet('Attribute', "q") function in combination with BadVal() to bypass the problem.
PS! If you use PI AF SDK, the equivalent to BadVal() is the IsGood() property on the AFValue object. This, however, considers questionable values as good.