Minor changes + improves tests