Fixed fatal error in API, closes #692