Fix some bugs with escaping and recursion.
Make installation work and adapt the opam package.