added comments
moved init (helper) calls to init function
added missing arguments
calculation of ary length fixed
made the (static) process_errors() function inlined
added function comment
as default, return NULL
fixed whitespace
fixed function name