Improve reliability of certificate import

Fix issues with missing ownership by campaign runner and some code cleanup