FLEX-14181 stop RTE from occurring
FLEX-11930 Fixed condition around columns and rows and cleaned up comments.