Improve filename splitting