fix runAsModule detection with regexp

Sorry for the regexp, but i don't see any better way to do it.
Again, hopefully nothing breaks in other places.