Rearranged logical operators and the SEGFAULT seems to have gone away...?