More work on type checking in Semantic Analyzer