[Shell] Modified halt conditions according to the assignment.