typecast bugfix