This paper deals with discriminative optimisation of HMMs and hybrid models for continuous speech recognition. Using the well-known, sentence discriminative MMI criterion, we have observed a mismatch between error criterion and Viterbi recognition rate. We show how to overcome this, either by total likelihood scoring in the decoder, or by state-sequence discriminative optimisation criteria. We apply discriminative optimisation to a hybrid model, consisting of a continuous density HMM, and a linear or non-linear input transformation. Results are presented for TIMIT phone recognition, both on a small 5-class task, and the "standard" 39-class task.