Minor code cleanup and formatting changes.
Fix issue with association hash not getting the correct index which
could result in seg fault.