Added basic implementation of Expression.ResolveType(). Fixed minor bugs.