Fix interactive behaviour and phpunit tests