updated with fix from https://github.com/keenlabs/keen-js/blob/8c1c7c8bd5154db8e73ca5592f4da774bd5c46ca/src/core.js#L62-L73