Fixed inconsistency that could lead to segfault