Fix the logic with deciding if text is overlayed or not (plus some little fixes).