Make sure we are PHP 5.3 compatible
Merge pull request #765 from sjinks/native-buffering

Fix bugs in #763