Compilation fix re unused variables and functions