Added fixed array size variants of mgs and its related functions