Made size_t checks work with function return values.