FlxTrail improvements from Andrei Regiani