fix bug in unregister_from_filename()

Pretty self-explanatory. :)