a few more bugs fixed