optimized test, small fixes