Fix typecase