Minor fixes for problems found by dialyzer