Smarter way to avoid NaN for browserifiability.