Stack implementation with tests fixed.