Added null check for module to avoid #49.