fixed: various warnings about ambiguous code when compiled with gcc 4.3+, I tried to make safe judgements about the intention of the conditionals I modified and I beleive they are correct, however the original authors of these files may want to review the changes