Fixed bug in association mapping function