Fixed check on remaining data.