Fixed a rare segfault.