lots of fixes for shell