Added some assert statements