Some fixes to make it compile for AS 0.6.1