Fixed bug of trying to do .sub operation on a nil string.