These should have been guarded but are not, creating buffer out of bound access error on Apple devices.