toCaseInPlace finally works