Fix bug that occured when context was empty.