Herb's warning fixes. Also the POSIX locking fix.