applying fixes from nme-tilelayer