Reviewed-by: shade
Removed unreliable test, and replaced it with more robust one Reviewed-by: dholmes, iignatyev