Fix shared command history bug