More accurate right-trimming of meta-data
Code cleanup