Drop not used conditions
Add test for invalid SID