Remove unused variable and add missing define