Fix dtype assignment