fix for replacement functions, though this should better go directly to the antlr file
more tests, mostly for matrix operations