Clean up unused variables. Fix error for context menu