Reset the messages-property when clearing.
Removed unnecessary close method.

The  method was not needed. It was equivalent to  anyway.