Fixed docs and issue when checking for undefined