Some adjustments + added tests