Fix "add new file" sometimes ends with error. Fixes #55