minor changes + improve functional tests