Cleaned up pull request from @skaae. Thanks!