Bugfixes in new "stat" command