Type error in example