Fixed warning by explicitly casting to bool