fixed small bug where wrong data was being written for function references