Fix errors and add a simple window example