fix build/segv issues as reported and fixed by Brent Cook
fix build/segv issues as reported and fixed by Brent Cook

joel-porquet/tsar-uclibc,joel-porquet/tsar-uclibc,joel-porquet/tsar-uclibc,joel-porquet/tsar-uclibc