Fixed a divide by 0 error in the transcription function and added a zero_if_nan macro