Added schema checking and works with Py3.