Fixed syntax/runtime errors in isFirstRawRowValid method