Fixed bug when no gui provided to constructor