Added LPT, SPT.
Fixed a merging bug.
Other various bug fixes.