Added close behaviour, other fix.