fix missing gmaincontext + general improvement