misc bugs fix