many many many bug fixes