Fix for #942

This is a very trivial fix. Hope it at least help fix the bug.

The bug was caused because dataMax was undefined when control came to that block.