Changed from static_cast to != to avoid warnings