Fixes #1, solution provided by @jvolkman