warning fix - some missing cast is written, a useless variable is removed