More bug fixes for background estimation with time-reversed templates
These patches are essential bug fixes for the commits that I have already pushed to the master. Basically, these changes allow the existing codes to make use of the extra metadata correctly.