two bugs fixed