Fix issues with file edit form

From #5592 and #4403.

Fixes: 
1. Editing file after adding one would create new 'undefined' row
2. URL redirect fieldset on file edit form