fixed some issues found by dialyzer