A few more improvements on the semantic analysis