Changed implementation for update_record method and other small adjustments