Improve struct layout verification and STV build fix