This code mixes up int and uint32 when pulling out of a TDB. This is very bad. Fixing...