various fixes

quite a few fixes. some good (BC Math stuff), some a little bit dirty that may need some attention...sorry!