Start with the mode line

Change-Id: I0156daaa12cfe147df26be061bc037d291d4f0c6
Avoid possible memory leaks in case of exceptions

Change-Id: I6542885b0de6dad0244726f1ee8bf9cdc851e746