by slashrsm: Some fixes.