Fixes almost all bas tests except test 17. Needs more debugging stuff. T...

...hese fixes will be temporary (will be deleted in next deliverables)