Fixes two bugs in shell (again)