Fixed --datadir getting ignored when already set
Use os.path.join() instead of string appending