Fixed handling of filename changes.
Fix for #8