Added checks and tests