Clean up logic for detecting overflow
Clean up logic for detecting overflow

ChromaPDX/openassets,illan/openassets-js,TOMOAKI12345/openassets,cloudzombie/openassets-js,andrewfhart/openassets,olalonde/openassets