Fixed extremely elusive segfault caused by a bad cast in camera.c