made the QApplications more failsafe by having a try-except block around the initialization. If one exists already, we simply extract it. Also made latex support try-except instead of massive fail.