Previously, the code was skipping various tests and not skipping others that it should. Fix both of these cases.