Add timeout and autoexpand support