fixed bug in shell() and added more test cases