Partial fix for firstInvalid