shell: fix compile warning and add some comments