Compile fixes

Fixes for bison 2.5 (used on the current Ubuntu LTS) and for newer GCC versions (4.8).