Changed some of value bounds and fixed some bugs.