[Cleanup]: Add Tests to the code (`@NeedsTest`)
This issue is a cleanup task to add unit tests to specific parts of the codebase marked with the `@NeedsTest` annotation. The goal is to create regression tests that would have caught previously identified bugs, ensuring code stability. Developers are instructed to find usage of the annotation, verify the methods are in use, write unit tests, and submit a pull request.