Some fixes and additions