Make onReceivedElement take const unsigned char *