1) fixes some bugs introduced with the last commit