Corrected negation bug that would always cause an undefined error