fixed most tests and some new issues