Fixed resize() and add() and added Exceptions