Compile fixes from Andrew