Fixed predict
Various fixes