fix umtrx-specific compilation warnings

Only warnings introduced by umtrx-specific code are fixed to avoid conflicts on upstream merge. Also some dead code removed to improve readability.