Fixes to semantic check