Added Linux support; improved debugging