Added XQuartz and fixed some bugs