few minor bugs fixed