Added error-checking to handle odd null-grid behavior.
