fix warnings

please review and merge the fixes for warnings