Fixes for AS3 compatibility