Fix for bug in attract()