Added a world parameter to xpsign sql statment. And fixed various errors discovered during test builds.