Fixed incorrect cast from handle.