Fix error detection and update tests to tests only case covered.
Remove warning as it work now!