Fixed lit and out of range refresh

Also fixed error handling null obj ref