Fixing compiler warnings and some optimizations for the synthetic packing algorithms.