Corrected Document prototype extension.