Performance changes to libs and scripts