fix bugs on UmdWriter and UmdReader