Added checks + other small changes