Fix error for mode 'file_add'.
Added tests for dir add and dir remove modes.