Fix command completion (bug #988)