Add OriginalMapping class
Fix bugs