Fixing various warnings, including some omissions on the error code change..