More improvements on the semantic analysis