I think in your code you have a line like (for-each free-sample-reader readers) which applies free-sample-reader to each member of the list readers. Since this list can now have #f as well, that line needs to be (for-each (lambda (r) (if r (free-sample-reader r))) readers) or some reasonable facsimile thereof.