Fix segfault in zbeacon (#596)