Added code to flush the args array and fixed cd with no args