More specific errors

Changed the UnexpectedValueExceptions to specify which segment is encoded incorrectly.