Some portability fixes.
Merge pull request #72 from PiranhaCMS/portability-fixes

Some portability fixes.