Test improvements

@steveoh Would you mind looking this over?