misc bugs fixed