Fix IndexOutOfBoundsException when payload is empty and add a fix for payloads containing '='.