Fixes #1 as suggested by @crayxt