Corrected strdup -> g_strdup, beautified tabs->spaces, "{" in new line