Fixed bad access when using non objective c objects as objective c objects