Added thread-safe init wrapper.
Fixed functions and methods outline and return values (errors).