Fixed a bug whereby median differences were still computed even when gamma was specified. Other small fixes.