hmm also not related to your changes: I am wondering why $firstColumn is used with a null check in some of this conditions and in some not.. seems to be unnecessary