Assert index param is not None. fixes #138