Fix -Wtype-limits warnings and remove disabling of -Wtype-limits