Remove unused variable
add explicit conversions to reduce warnings