Additional tests and minor fixes