Fixing shell bugs