Fixed a bug in TMBitmaps cleanup code.