Add one-hot conversion and additional tests