fixed minor bugs to enable compilation