Adding missing inline qualifiers for Cast function