FIX: some data-type problems with fminbounds optimization function