Bugfix/dialyzer

fix dialyzer errors. could still use some more specs and rafter specific types to clean up the existing specs.