Fixed crash for wrong struct type cast