init vars properly, use safer string compare function

g_strcmp0 on two NULLs gives 0, so the logic is preserved here