Made click simulation work better; Add tests