Added missing limit.h includes, and made use of PATH_MAX consistent.
Merge branch 'daniel_2514' into next