Script VM & bugs fixed