I fixed some errors.
I made the swith from anonymous structs for C++ compatibility.