Remove empty keys for FileRegistry
Style: use 'tables.' instaed of 't.'
Close all handlers before trying to remove the file
Use integer division for computing indices
Fixed a warning related to non-unicode filenames