Adding cast offset support for diagnostic purposes