Fix phpcr initialisation and stabilise build