Fixes for bad frames

Fixes in frame_align and hmm for frames of all equal values and all NaN values, respectively.