Fix bug in sample code (missing error parameter)