Made cls param on decode() optional.