fixed function return value bug in VM; extended array library