Fix Close Function, Manage Panel Correctly

- Fixes #50