Fix functions for RFC3548