Minor typecast errors solved