Additional test and bug fixes