fixed a bug in the if-statement and a typo

Fixed a bug that incorrectly checks `rowspan` and `colspan` out of bounds conditions.
`Incorrect parameters: colspan or rowspan out of bounds`
Merge pull request #1 from zmian/master

Fixed a bug that incorrectly checks `rowspan` and `colspan` out of bounds conditions.