Rewrite internals, enable cover, fix dialyzer