Various testing improvements