Fixed a segfault me thinks