Remove unused variable optimization #451