Caused by a bad if check, which incorrectly executes for both 0 and None, when None was the original intent.