More performance improvements, fixes