Misc system improvements and bug fixes