Fix menu divider bug and small code clean up