Adding tests and correctly cancel timeout future