Issue66 credential expiration fix

Please note this also includes the fix for commit c48e23b