Added use of remote database if passed - defaults to current