Fix file-handling interface bug.

Fix bug wherein clicking "Choose file ...", selecting a valid file, then
immediately clicking "Choose file ..." again and hitting cancel caused an
attribute lookup on undefined.
Merge branch 'master' into gh-pages