Fix unitialized variables. Remove unnecessary type-cast.