Fixed some problems with stack class