Fixed lib_curate bugs found during Unit test