Add more tests and update the behaviour of the application.
Fix a few mistakes.