Fix a couple of lifetime related crashes