I recently found out that /close does not trigger the on close event... Just a little bug, but it does make some problems for scripters out there.