fixed bugs in save dialog and getting file names in lua

Ignore-this: b845171737d241cc52963ad5ba47b44d

darcs-hash:20130502010221-c21fe-84c96bbd97e0ee7acf8d534f24943d3e2b2b7068