Feature/bugfix #1012

Check for undefined since some cells are hidden.