Add some additional bounds testing code
Some minor code cleanup