Bug correction + code improvement in ui.append_log()