improved testing
many small fixes