Fixing the errors Matt pointed out in his review, mostly Doc related.