Fix bug. and add some headers.