Assertion cast fix