Fix issues & add a failure scenario