Fix issues 17, 18 and 19