Making code and templates nil-safe