fixing code review defects
fixing possible negative table size
removing debug statements, minor cach rebalancing tweak