Set a default optimizer if none is defined. Fixes issue #37.