h8300: Fix coverity issues, fix tests.

Fix coverity + Fix for tests