Further fixes to auth middleware
Version 1.2.4