Assert index param is not None. fixes #138

When checking if index exists and None given as parameter, Throws TypeError exception.