Fixes errors with -pedantic -std=c99 and GCC 4.7.2

Same patches as sent to the mailinglist.