some fixes, more bugs. check todo for buglist