Fixed compile errors.

Fixed various compile errors introduced by pull request #530.
Merge pull request #531 from adrianbroher/master

Fixed compile errors.