Bugfixes after CLI implementation