Fix some bugs in Angelscript API, #572.