At first glance the changes in this section look good, but I need to test it before further commenting on it.