fixes, extend

including the addition of cutPhpError()