many fixes for use with passenger, still some errors left
many fixes for use with passenger, still some errors left