Add missing test files and correct various compilation errors