chore: Fix bugs, add unit tests and add coverage reporting