Rewriting adaptor.h: removing register keyword and fixing illegal variable names.