Fix bugs in current_user assignment