Fix precedences and some unit tests

22 failures left