Minor fixes to the shell and the host function