Updated to allow custom data dir