Add type checking to cons