Bug fix and shell mode