Fixed some bugs. Added integrated Asserts