Fixed a bug when running in single mode