add debug info, fix type for elements of allopts, code cleanup