Not sure what you mean by not checking for errors correctly.
Things I see possibly wrong with the code:
- ‘Test’ is not a logical expression.
- If test is a variable containing a logical expression it is not BINDed
- PROP:Filter should come before the open(MyView)