some fixes from FlixelCommunity