OK, it is very likely a bug in the version of chromium I was testing in. Add a comment to explain why the parseInt is so important.