fixed filename length, fixed wrong extension adding