Return all errors via promises. Fix jsDoc.