Don't try to access first element of collection when list is empty (fixes #76)