Added testing code for build_imm.