Fixed base dir calculation