fixed segfault when not specifying smf filename, also cleaned