Performance improvements, fixes and sample options