Fixed mistake in emptiness check