Added new class-methods

Fixed a couple of issues, added more class-methods, and also added a safe_exit class-method.