misc: tests, bug fix, compilation script.