bugfix in the pattern matching compiler and a number of other fixes that I somehow did not push before