Start adding simple type checking (work in progress).