Fix some hank with ugly code