Optimize: we know uidvalid is an integer, so no need to serialize
Fix undefined error
Correctly extend base class for test cases