Fixed predict so that it works with non-integer mdim