Handled some error cases.