Fixes directoy buffer