Fix mog2 implementation