Fix modified file detection incorrectly picking up directories after 'type' was removed