Fix typecase ordering