fixed dialyzer warnings, added test coverage