Fixed mainloop calling startup after line error