Fix SIGSEGV on reload / upgrade (take 2).

Signed-off-by: Piotr Sikora <piotr.sikora@frickle.com>