Removed unnecessary require calls and added check on cursor constructor.