Small improvements and fixes