Fix: Removed chance of memory leak by state switching.
Changed State's destructor to virtual.