Fixed memory allocation errors, and shell is now running for all provided correct test cases.