adjust filename creation to avoid os seperators + empty filenames. Fixes #11, Fixes #12