Added workaround for argument passed by reference and php 5.4
gh-291