Add unit tests for ErrorCorrectionLevel and fix a bug in enum implementation