Bug fix
Added first tests