Some updates to internals with stats and error reporting