Reimplemented the lost filepath checking code. Added Unit test for filepath checking
Fixed merge conflicts