Fix typecast error