Fixing compile error and adding docs