Tests were added to the project. Fixes of bugs that I faced up with.