Add error management + tests

Add util.format also to have neat string.