Fix uniform related bugs