ThrowablesFactory: fix code, add tests