Added pickling optimization.