Fix unused variable and add docblocks