Change ceiling test to be deterministic