Added a settings panel and some fixes