Added assertions and simplified tests