Fixes to statement validation