Updated java to handle 'error' cells