Test and minor fixes