Fix digitalPulse length (properly) - fix #154
Making sure that undefined gets cast to NaN
Fix Array.indexOf() returns undefined instead of -1 - fix #155