Fix dune 2.3 issues

This fixes compilation with dune 2.3 and quells some warning.
There is one nasty warning left which needs more thought to it than i had to offer right now..