Fixed adding elements and resizing. Throws exceptions for null keys.