v0.6.5:improved invalid filename detection