Added StockException and tests