Fixed segfault reported by heroxbd