Added unit tests for writer
Fixed several small mistakes
Fixed value label parsing