Fixes base_template.load and remove_template_definition which fail when the userdata is empty / None or when the userdata has only one line. Change-Id: I2ba0e16489049be390b2c9bc1fdf1e1059f54eb1