Fixed a potential seg fault