Fixed segfault caused by strcmp to NULL