Minor improvements and fixes