Fixed text Y position being off; it was offset by the entire font size, instead of the distance from the top to the baseline.
Minor improvements (naming, comments, static_pointer_cast).