[backend] Fix issues with credentials code.