Fix segfault in the zoom function