Fix code injections and expiry date handling wrt #1 and #2
Minor style fixes
Update TODO