bugfix for isEmpty and test