Auth bugfix

Minor fix for issue #336