Bugfix in clear method: size is now correctly reset to 0