Fix portal creation crash.

also affects 0.9.