Improved file-specific handling.