Fixed usage of empty()