Fix $LR_DATE handling and add several hacks to fix running from boot script