Added batch features and bug fixes