Filename and socket bugfixes.