'document' errors fixed