[MAT-387] Fix some errors in check_expressions.