Improvements to the handbook + related code fixes