Small fix to make code usable as module