Fixed a crash with the background mode & fixed a bug in QtWriter