Fix bad usage of empty() function