Actually create ent() function. Various other fixes.
Actually create ent() function. Various other fixes.

MorusAB/commonlib-fmg,MorusAB/commonlib-fmg,MorusAB/commonlib-fmg,MorusAB/commonlib-fmg,MorusAB/commonlib-fmg,MorusAB/commonlib-fmg,MorusAB/commonlib-fmg,MorusAB/commonlib-fmg