fixed bug in unused variable warnings

(closures were not ignored correctly)