Fixed type error found by dialyzer.