Fixed thread leak. Minor rain performance improvements.