Fixes for proxy and php 5.4