Simplify stack operations and remove accidentally commited code.