Add unused variable warning and adjust code accordingly