added more nil checks for integer types