fix for CompileStatic
fix unit tests