A bit more efficient checking