Handling nil association data and adding regression tests from pobocks paranoid branch.