Some bug changes, and a critical fix to fitness function.