Fixes for bad shell behavior