minor errors in encoding