Added length check for comparing two byte arrays