Fixed error with empty case