Added asserts to weed out error