Bug fix
Adding basic tests and fixing at least one bug