updated and finalized tests. last bugfixes