Fix nil vs present in test