improve error handling on unknown union cases
add some missing doc comments