Improve tests and add 1.9 support